<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>角色管理</title>
	<!-- import css and js --> 
	<%@ include file="/common/metaInput.jsp" %>  
<script type="text/javascript">
$(function(){
$("#inputForm").validate({			   
	onsubmit: true,
	 /*执行ajaxsubmit  */ 
    submitHandler: function(editform) {
            
        //alert(jsonInfo); 
        try{			    		
            url =  "${ctx}/security/roleplace/save.do";
            var api = frameElement.api;
        	var W = api.opener;
        
        
            getReturnMessage(url,"inputForm",W.searchAP($("#rolename").val()));	
        }catch(e){alert(e)}
    }
 }
);

$("#resources").change(function(){
	$("#resourcesname").val($("#resources").find("option:selected").text());
});
})
function submitForm(param){
	
    //设置ajax全局同步
	jQuery.ajaxSettings.async = false;
  	$("#submitFlag").val(param);
    $("#inputForm").submit();
 }	


		
	
</script>

</head>

<body>

<form id="inputForm" action="" method="post">
<input type="hidden" id="id" name="id" value=""/>
<input type="hidden" name="type" value="WH"/>

 <div class="pageContent" >
    <div class="panel"  style="height: 90%">
         <table class="TableBlock" align="center" style="height: 90%">
                
                   <tr>
   		               <td nowrap>角色名称:</td>
   		               <td><input type="text" id="rolename" name="rolename" class="required" value="${role.name}" /></td>
   		           </tr>
                   <tr>
   		               <td nowrap>角色描述:</td>
   		               <td><input type="text" id="roledescribe" name="roledescribe" class="required" value="${role.description}" /></td>
   		           </tr>
   		           <tr>
   		             <td nowrap>操作仓库:</td>
   		             <td >
   		                <select  id="resources" class="required" name="resourcescode">
   		                <option id="" value=""></option> 
   		                 	<c:forEach items="${bclist }" var="whInfo">
   		                 		<option id="${whInfo.zd002Code }" value="${whInfo.zd002Code }">${whInfo.zd003Name }</option>
   		                 	</c:forEach>
   		                </select>
   		                <script>
   		                	$("#"+"${rolePlace.resourcescode }").attr("selected","selected");
   		                	$("#resourcesname").val($("#resources").find("option:selected").text());
   		                </script>
   		                <input  id="resourcesname" class="required" hidden="true" name="resourcesname"  value="" /> 		                 
   		             </td>
   		         </tr>
   		         <tr>
   		               <td nowrap>备注:</td>
   		               <td><input id="roledescribe" name="roledescribe" value="" /></td>
   		           </tr>
         </table>               
         </div>
         <div class="formBar">
	        <ul>
		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save" onclick="submitForm(1)">保存</button></div></div></li>
		       <li><div class="button"><div class="buttonContent"><button type="button" class="print" onclick="CloseDialog()">关闭</button></div></div></li>
	        </ul>
        </div>    
    </div>
</form>
</body>
</html>
